from pynput.keyboard import Key, Controller as key_cl
from pynput.mouse import Controller, Button
import time


def keyboard_input(string):
    keyboard = key_cl()
    keyboard.type(string)


def mouse_click():
    mouse = Controller()
    keyboard = key_cl()
    mouse.press(Button.left)
    mouse.release(Button.left)
    keyboard.press(Key.enter)


def main(number, string):
    time.sleep(2)
    for i in range(1, number):
        keyboard_input(string+'【第'+str(i+1)+'条】发送成功')
        mouse_click()
        time.sleep(2)
if __name__ == "__main__":
    main(10000, "彭磊多喝点热水")
